'use strict';
/** @type {import('sequelize-cli').Migration} */
module.exports = {
  async up(queryInterface, Sequelize) {
    await queryInterface.createTable('edu_user_companies', {
      id: {
        allowNull: false,
        autoIncrement: true,
        primaryKey: true,
        type: Sequelize.INTEGER.UNSIGNED,
      },
      user_id: {
        allowNull: false,
        type: Sequelize.INTEGER.UNSIGNED,
        comment: '用户ID',
      },
      province_id: {
        allowNull: false,
        type: Sequelize.INTEGER.UNSIGNED,
        comment: '省ID',
      },
      city_id: {
        allowNull: false,
        type: Sequelize.INTEGER.UNSIGNED,
        comment: '市ID',
      },
      area_id: {
        allowNull: false,
        type: Sequelize.INTEGER.UNSIGNED,
        comment: '区ID',
      },
      address: {
        type: Sequelize.STRING,
        comment: '子公司详细地址',
      },
      deleted_at: {
        type: Sequelize.DATE,
      },
      created_at: {
        allowNull: false,
        type: Sequelize.DATE,
      },
      updated_at: {
        allowNull: false,
        type: Sequelize.DATE,
      },
    });
  },
  async down(queryInterface, Sequelize) {
    await queryInterface.dropTable('edu_user_companies');
  },
};
